home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / misc / sci / Squid.lha / Squid / Squid.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-06-23  |  2.3 KB  |  79 lines

  1. #include "squid_class.h"
  2. #include <iostream.h>
  3. #include <stdlib.h>
  4. #include <clib/alib_protos.h>
  5. #include <clib/asl_protos.h>
  6. #include <clib/dos_protos.h>
  7. #include <clib/exec_protos.h>
  8. #include <clib/gadtools_protos.h>
  9. #include <clib/graphics_protos.h>
  10. #include <clib/intuition_protos.h>
  11. #include <clib/locale_protos.h>
  12. #include <clib/utility_protos.h>
  13. #include <clib/wb_protos.h>
  14. #include <clib/colorwheel_protos.h>
  15. #include <clib/datebrowser_protos.h>
  16. #include <clib/resource_protos.h>
  17. #include <clib/texteditor_protos.h>
  18. #include <gadgets/colorwheel.h>
  19. #include <gadgets/datebrowser.h>
  20. #include <gadgets/gradientslider.h>
  21. #include <gadgets/tapedeck.h>
  22. #include <gadgets/texteditor.h>
  23. #include <proto/texteditor.h>
  24. #include <reaction/reaction.h>
  25. #include <intuition/icclass.h>
  26. #include <intuition/imageclass.h>
  27. #include <intuition/gadgetclass.h>
  28. #include <workbench/startup.h>
  29. #include <wbstartup.h>
  30.  
  31. Object *winobj=NULL;
  32.  
  33. struct Window *win=NULL;
  34.  
  35. void main()
  36. {
  37.     int x=0, i=0;
  38.     cout <<"combien d'objets? ";
  39.     cin >>x;
  40.     Cell *C = (Cell*) malloc(x*sizeof(Cell));
  41.     if(C==NULL)
  42.     {
  43.         cout <<"erreur d'allocation\n";
  44.     }
  45.     else
  46.     {
  47.         cout <<"allocation de " <<x <<" objets effectuée\n";
  48.         cout <<"la mémoire utilisée est de " <<x*sizeof(Cell) <<" octets\n";
  49.  
  50.         winobj = (Object*) WindowObject,
  51.             WA_Left,    100,
  52.             WA_Top,     100,
  53.             WA_Width,   300,
  54.             WA_Height,  300,
  55.             WA_DragBar, TRUE,
  56.             //WA_Title,   "Sortie graphique",
  57.             WA_PubScreen, Screen1,
  58.             //WA_CloseGadget,  TRUE,
  59.             WA_DepthGadget, TRUE,
  60.             WA_SuperBitMap, TRUE,
  61.             WA_IDCMP,  IDCMP_GADGETDOWN | IDCMP_GADGETUP | IDCMP_GADGETHELP | IDCMP_MENUPICK | IDCMP_MENUHELP | IDCMP_CLOSEWINDOW | IDCMP_ACTIVEWINDOW | IDCMP_INACTIVEWINDOW | IDCMP_RAWKEY | IDCMP_VANILLAKEY | IDCMP_MOUSEBUTTONS | IDCMP_MOUSEMOVE | IDCMP_NEWSIZE | IDCMP_CHANGEWINDOW | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW | IDCMP_INTUITICKS,
  62.             WA_RMBTrap, TRUE,
  63.         EndWindow;
  64.         win = RA_OpenWindow (winobj);
  65.         winport = win->RPort;
  66.         DrawEllipse(RPort, 50, 50, 10, 20);
  67.  
  68.         free(C);
  69.         /*if(C==NULL)
  70.         {
  71.             cout <<"mémoire libérée\n";
  72.         }
  73.         else
  74.         {
  75.             cout <<"échec de libération\n";
  76.         }*/
  77.     }
  78. }
  79.